package com.hrm.system.client;

import com.hrm.common.entity.Result;
import com.hrm.domain.company.Department;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(value = "hrm-company") //请求的服务器名
public interface DepartmentFeignClient {
    //根据id获取部门
    //@RequestMapping注解用于对被调用的微服务进行地址映射
    @RequestMapping(value = "/company/department/{id}",method = RequestMethod.GET)
    public Result findDepartmentById(@PathVariable(value = "id") String id);

    @RequestMapping(value = "/company/department/search", method = RequestMethod.POST)
    public Department findByCodeAndCompanyId(@RequestParam(name = "code") String code, @RequestParam(name = "companyId") String companyId);
}
